#!/bin/bash
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES

# Create AnalyticsDSN
# Navigate to the directory where the file should be created


CLIENTS_PATH="${CI_PRIMARY_REPOSITORY_PATH}/BatFiKit/Sources/ClientsLive"
cd ${CLIENTS_PATH}

# Check if the directory exists
if [ ! -d ${CLIENTS_PATH} ]; then
    echo "Directory not found!"
    exit 1
fi

# Create the Swift file with the environment variable value
echo "import Foundation" > AnalyticsDSN.swift
echo "" >> AnalyticsDSN.swift
echo "// This file is automatically generated in the CI process." >> AnalyticsDSN.swift
echo "// Do not modify or check into version control." >> AnalyticsDSN.swift
echo "let analyticsDSN = \"${SENTRY_DSN}\"" >> AnalyticsDSN.swift
// print content of the file
cat AnalyticsDSN.swift